function setRem() {
    //ui尺寸
    let uiSize = 750;
    //理想视口尺寸
    let winSize = document.documentElement.clientWidth;
    //375 iphone6的宽度
    let app = document.getElementById('root');
    //let footer = document.querySelectorAll('.footer')[0];
    let header = document.querySelectorAll('.fixed')[0];
    //如果视口尺寸大于设计尺寸750时，就显示750宽度范围
    if (winSize > uiSize) {
        app.style.width = uiSize + 'px';
        app.style.margin = '0 auto';
        app.style.border = '';
        //footer.style.width = uiSize + 'px';
        header.style.width = uiSize + 'px';
        return;
    }
    if (winSize <= 375) {
        winSize = 375;
    }
    //给html元素设置font-size值
    document.documentElement.style.fontSize = winSize / uiSize * 100 + 'px';
    app.style.width = winSize + 'px';
    app.style.border = 'none';
    //footer.style.width = winSize + 'px';
    header.style.width = winSize + 'px';
}

//当页面加载的时候执行的函数
onload = function() {
    setRem();
};
//当页面缩放的时候
onresize = function() {
    setRem();
};

